package org.dromara.authcode.domain.bo;

import org.dromara.authcode.domain.AuthCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 激活码业务对象 auth_code
 *
 * @author Miles Meng
 * @date 2025-08-08
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = AuthCode.class, reverseConvertGenerate = false)
public class AuthCodeBo extends BaseEntity {

    /**
     * 激活码ID
     */
    @NotNull(message = "激活码ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 激活码
     */
    @NotBlank(message = "激活码不能为空", groups = { AddGroup.class, EditGroup.class })
    private String code;

    /**
     * 使用用户ID
     */
    private Long userId;

    /**
     * 状态：0-未使用，1-已使用，2-已过期
     */
//    @NotNull(message = "状态：0-未使用，1-已使用，2-已过期不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long status;

    /**
     * 过期时间
     */
    private Date expireTime;

    /**
     * 授权时间
     */
    private Date authTime;

    /**
     * 商品ID
     */
    private Long goodsId;

    /**
     * 有效月数
     */
    private Long validMonths;


}
